import { createApp } from "vue"
import { createPinia } from "pinia"
//pinia数据持久化
import { usePersist } from "pinia-use-persist"
//引入elementUI
import ElementPlus from "element-plus"
//引入elementUI的样式
import "element-plus/dist/index.css"
//引入element的字体图标
import * as ElementPlusIconsVue from "@element-plus/icons-vue"
//引入粒子效果
import Particles from "vue3-particles"
import App from "./App.vue"
import router from "./router"
import ECharts from "vue-echarts"
import "echarts"
import "./assets/main.css"

const app = createApp(App)
const pinia = createPinia()
pinia.use(usePersist)
app.use(pinia)
app.use(router)
//注册elementUI插件
app.use(ElementPlus)
//注册element中的所有字体图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 注册粒子特效
app.use(Particles)
app.component("ECharts", ECharts)
app.mount("#app")
